import VueRouter from 'vue-router'

// 导入对应的路由组件
import HomeContainer from './components/tabbar/HomeContainer.vue'
import MemberContainer from './components/tabbar/MemberContainer.vue'
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import NewsList from './components/news/NewsList.vue'
import NewsInfo from './components/news/NewsInfo.vue'
import PhotoList from './components/photo/PhotoList.vue'
import PhotoInfo from './components/photo/PhotoInfo.vue'
import GoodList from './components/good/GoodList.vue'
import GoodInfo from './components/good/GoodInfo.vue'
import GoodDesc from './components/good/GoodDesc.vue'
import GoodComment from './components/good/GoodComment.vue'


// 3. 创建路由对象
var router = new VueRouter({
    routes: [ // 配置路由规则
        { path: '/', redirect: '/home' },
        { path: '/home', component: HomeContainer },
        { path: '/member', component: MemberContainer },
        { path: '/shopcar', component: ShopcarContainer },
        { path: '/search', component: SearchContainer },
        { path: '/home/newsList', component: NewsList },
        { path: '/home/newsinfo/:id', component: NewsInfo },
        { path: '/home/photoList', component:PhotoList},
        { path: '/home/photoinfo/:id', component:PhotoInfo},
        { path: '/home/goodList', component:GoodList},
        { path: '/home/goodInfo/:id', component:GoodInfo, name:'goodInfo'},
        { path: '/home/goodDesc/:id', component:GoodDesc, name:'goodDesc'},
        { path: '/home/goodComment/:id', component:GoodComment, name:'goodComment'}
    ],
    linkActiveClass:"mui-active"
})

// 把路由对象暴露出去
export default router
